<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        let a=true
        function show() {
            var div= document.getElementById('div')
            if (a) {
            a=!a
            var newH2=document.createElement('h2')
            var text =document.createTextNode('封校三天 快乐无边')
            newH2.appendChild(text)
            div.appendChild(newH2);
            }
            
            var newButtom=document.getElementById('button')
            if (newButtom.value==='展开') {
                div.style.display=''
                newButtom.value='收起'
            }else{
                div.style.display='none'
                newButtom.value='展开'
            }          
        }
    </script>
    <input type="button" value="展开" onclick="show()"id="button" >
    <div id="div"style="display: none"></div>
    
</body>
</html>